package com.ap.core.common.types;

import com.ap.core.cxf.jaxb.common.TxChannelEnum;


/**
 * User: Ranjit.Singh
 * Transaction Channel Type used in AP.
 */
public enum TransactionChannelType {

    MOBAP(TxChannelEnum.MOBAP);

    private TxChannelEnum txChannelEnum;

    private TransactionChannelType(TxChannelEnum txChannelEnum) {
        this.txChannelEnum = txChannelEnum;
    }

    public static TransactionChannelType valueOf(TxChannelEnum txChannelEnum) {
        for (TransactionChannelType transactionChannelType : values()) {
            if (transactionChannelType.txChannelEnum == txChannelEnum) {
                return transactionChannelType;
            }
        }

        // not found
        throw new IllegalArgumentException("Unable to determine Transaction Channel Type: txChannelEnum= " + txChannelEnum);
    }

    public TxChannelEnum getTxChannelEnum() {
        return txChannelEnum;
    }

}
